<template>
	<section id='page__goods-manage'>
		<goods-list :is-admin="true"/>
	</section>
</template>

<script>
  /**
   *
   *
   *
   */
  import GoodsList from './list'

  export default {
    name: "manage",
    data() {
      return {
        form: {
          keyword: '',
          page: 1,
          size: 10
        }
      }
    },
    methods: {
      search() {
        this.form.page = 1
        this.getList()
      },
      changePage(page) {
        this.form.page = page
        this.getList()
      },
      async getList() {
        this.loading = true
        let tableData = [],
          total = 0
        await this.$axios.get('/user/list', {
          params: this.form,
          abort: true
        }).then(({success, data}) => {
          if (success) {
            tableData = data.content
            total = data.total
          }
        }).catch(thrown => {
          // if (axios.)
        }).finally(() => {
          this.loading = false
        })
        this.tableData = tableData
        this.total = total
      },
    },
    components: {
      GoodsList
    }
  }
</script>

<style lang='less'>
	.goods-manage {
		.view__main {
			background-color: transparent !important;
		}

		.page__header {
			background-color: #fff;
		}
	}

	#page__goods-manage {
		display: flex;
		flex-direction: column;
		flex-grow: 1;

		.page__main {
			background-color: transparent;
			padding: 0;
			flex-shrink: 1;
			flex-grow: 1;
			display: flex;
			flex-direction: column;
		}
	}
</style>
